Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

IF2(false, x) → WEIGHT(sum(x, cons(0, tail(tail(x)))))
IF2(true, x) → HEAD(x)
IF2(false, x) → SUM(x, cons(0, tail(tail(x))))
IF(false, b, x) → IF2(b, x)
WEIGHT(x) → EMPTY(tail(x))
WEIGHT(x) → EMPTY(x)
WEIGHT(x) → IF(empty(x), empty(tail(x)), x)
SUM(cons(0, x), y) → SUM(x, y)
WEIGHT(x) → TAIL(x)
IF2(false, x) → TAIL(x)
IF2(false, x) → TAIL(tail(x))
SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

IF2(false, x) → WEIGHT(sum(x, cons(0, tail(tail(x)))))
IF2(true, x) → HEAD(x)
IF2(false, x) → SUM(x, cons(0, tail(tail(x))))
IF(false, b, x) → IF2(b, x)
WEIGHT(x) → EMPTY(tail(x))
WEIGHT(x) → EMPTY(x)
WEIGHT(x) → IF(empty(x), empty(tail(x)), x)
SUM(cons(0, x), y) → SUM(x, y)
WEIGHT(x) → TAIL(x)
IF2(false, x) → TAIL(x)
IF2(false, x) → TAIL(tail(x))
SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 7 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ QDPOrderProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SUM(cons(0, x), y) → SUM(x, y)
SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


SUM(cons(0, x), y) → SUM(x, y)
The remaining pairs can at least be oriented weakly.

SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))
Used ordering: Polynomial interpretation [25,35]:

POL(cons(x1, x2)) = 4 + x_2   
POL(SUM(x1, x2)) = (2)x_1 + (11/4)x_2   
POL(s(x1)) = 3 + (3)x_1   
POL(0) = 3/4   
The value of delta used in the strict ordering is 8.
The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ QDPOrderProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


SUM(cons(s(n), x), cons(m, y)) → SUM(cons(n, x), cons(s(m), y))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Polynomial interpretation [25,35]:

POL(cons(x1, x2)) = (4)x_1   
POL(SUM(x1, x2)) = (4)x_1   
POL(s(x1)) = 1 + (4)x_1   
The value of delta used in the strict ordering is 16.
The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
QDP
                    ↳ PisEmptyProof
          ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

IF2(false, x) → WEIGHT(sum(x, cons(0, tail(tail(x)))))
IF(false, b, x) → IF2(b, x)
WEIGHT(x) → IF(empty(x), empty(tail(x)), x)

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


IF2(false, x) → WEIGHT(sum(x, cons(0, tail(tail(x)))))
The remaining pairs can at least be oriented weakly.

IF(false, b, x) → IF2(b, x)
WEIGHT(x) → IF(empty(x), empty(tail(x)), x)
Used ordering: Polynomial interpretation [25,35]:

POL(IF2(x1, x2)) = (1/2)x_1 + (1/4)x_2   
POL(empty(x1)) = (2)x_1   
POL(cons(x1, x2)) = 1/4 + (4)x_1 + (4)x_2   
POL(tail(x1)) = (1/4)x_1   
POL(WEIGHT(x1)) = (1/2)x_1   
POL(true) = 0   
POL(false) = 1/2   
POL(sum(x1, x2)) = (3/2)x_2   
POL(s(x1)) = 0   
POL(IF(x1, x2, x3)) = (1/2)x_2 + (1/4)x_3   
POL(0) = 0   
POL(nil) = 0   
The value of delta used in the strict ordering is 1/16.
The following usable rules [17] were oriented:

empty(cons(n, x)) → false
empty(nil) → true
tail(cons(n, x)) → x
tail(nil) → nil
sum(cons(0, x), y) → sum(x, y)
sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(nil, y) → y



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

IF(false, b, x) → IF2(b, x)
WEIGHT(x) → IF(empty(x), empty(tail(x)), x)

The TRS R consists of the following rules:

sum(cons(s(n), x), cons(m, y)) → sum(cons(n, x), cons(s(m), y))
sum(cons(0, x), y) → sum(x, y)
sum(nil, y) → y
empty(nil) → true
empty(cons(n, x)) → false
tail(nil) → nil
tail(cons(n, x)) → x
head(cons(n, x)) → n
weight(x) → if(empty(x), empty(tail(x)), x)
if(true, b, x) → weight_undefined_error
if(false, b, x) → if2(b, x)
if2(true, x) → head(x)
if2(false, x) → weight(sum(x, cons(0, tail(tail(x)))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.